Method and system for decomposing single-qubit quantum circuits into a discrete basis

ABSTRACT

A target quantum circuit expressed in a first quantum gate basis may be transformed into a corresponding quantum circuit expressed in a second quantum gate basis, which may be a universal set of gates such as a V gate basis set. The target quantum circuit may be expressed as a linear combination of quantum gates. The linear combination of quantum gates may be mapped to a quaternion. The quaternion may be factorized, based at least in part on an amount of precision between the target quantum circuit and the corresponding quantum circuit expressed in the second quantum gate basis, into a sequence of quaternion factors. The sequence of quaternion factors may be mapped into a sequence of quantum gates of the second quantum gate basis, where the sequence of sequence of quantum gates is the corresponding quantum circuit.

CROSS REFERENCE TO RELATED PATENT APPLICATIONS

This patent application claims the benefit of U.S. Provisional Application No. 61/800,033, filed Mar. 15, 2013, entitled “Efficient Decomposition of Single Qubit Gates into V Basis Circuits,” which provisional application is hereby incorporated in its entirety by reference.

TECHNICAL FIELD

The current application is directed to quantum computing and, in particular, to a method and system for compiling single-qubit unitary gates into circuits over a universal basis.

BACKGROUND

Enormous advances have been made in digital computing over the past 70 years. Crude, high-energy-consuming, vacuum-tube-based computer systems developed in the 1940s have evolved into today's personal computers, work stations, servers, and high-end distributed computer systems, based on multi-core single-integrated-circuit processors, that economically provide processing speeds, data-storage capacities, and data-transfer bandwidths that were unimaginable even 20 years ago. However, digital computing appears to be bounded by certain physical and problem-domain constraints.

In 1982, Richard Feynman made a suggestion for a new type of computational system based on quantum-mechanical components. He suggested that quantum computers could more efficiently address certain classes of computational problems than digital computers and, in the case of computational problems in computational chemistry and physics, provide practical approaches to computational problems that are intractable using digital computer systems. Since that time, great progress has been made in developing the theoretical foundation for quantum computing and the first quantum computers have been implemented. Various computational problems have been identified that can be addressed more efficiently by quantum computers than by classical digital computers. However, significant research and development efforts continue to be applied in order to provide practical and cost-effective general-purpose quantum-computing systems for widespread use. As one example, significant theoretical efforts are currently being applied to identify cost-effective implementations of quantum circuits.

Determining the optimal fault-tolerant compilation, or decomposition, of a quantum gate is critical for designing a quantum computer. Decomposition of single-qubit unitary gates into the {H, T} basis, where H is the Hadamard gate and T is the rotation about the z-axis by π/4, has been well studied in recent years.

However, there exists a need for alternative bases that may offer significant improvements in circuit depth or resource cost.

SUMMARY

The disclosure discusses techniques and systems which transform a given single-qubit quantum circuit expressed in a first quantum-gate basis into a quantum-circuit expressed in a second quantum-gate basis. The second quantum-gate basis comprises a universal set of quantum gates.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of an example environment for performing quantum calculations.

FIG. 2 is a schematic diagram of example quantum gates.

FIGS. 3-6 are schematic diagrams of example quantum circuits.

FIG. 7 is a schematic diagram of an example non-quantum computing device for use in the environment for performing quantum calculations.

FIGS. 8A-D illustrate an example quantum bit, referred to as a “qubit,” which is a fundamental data-storage unit of many quantum-computing systems.

FIG. 9 illustrates an example quantum circuit comprising two exemplary quantum gates.

FIG. 10 is a flow diagram of an example process for determining a replacement sequence of universal quantum gates.

DETAILED DESCRIPTION

Overview

This disclosure generally describes techniques for performing quantum calculations, and more particularly, describes techniques for determining a quantum circuit or a quantum gate in a particular gate basis set.

A quantum basis set is universal if any target gate can be approximated by a quantum circuit composed of the basis gates to arbitrary precision. One of the important universal quantum basis sets is V gate basis set. A unitary gate that is exactly representable in V basis is mapped to a quaternion of specific structure represented by an integer quaternion divided by an integer power of a normalization. (For example, if the V basis is normalized by √{square root over (5)}, then the quaternion is represented by an integer quaternion divided by an half-integer power of 5.) Such a quaternion can be uniquely factorized into a sequence of small quaternion factors, which can be subsequently uniquely mapped to a sequence consisting of the V gates and at most one Pauli gate. A target quantum gate can be approximated by a unitary gate that is exactly representable in V basis and the complexity of the latter is proportional to the logarithm of the desired precision. The practical construction of an approximating unitary gate requires search in a subset of unitary gates exactly representable in V basis; such search can be either randomized (and have probabilistically polynomial complexity) or exhaustive (and have exponential complexity).

One gate basis set is the V basis. The V basis contains rotations by θ=cos⁻¹(−3/5) around the x-, y-, and z-axis. For example, the matrix for the z-axis rotation, denoted as V₃, is given by

$V_{3} = {{\frac{1}{\sqrt{5}}\begin{bmatrix} {1 + {2i}} & 0 \\ 0 & {1 - {2i}} \end{bmatrix}} = {{\frac{1 + {2i}}{\sqrt{5}}\begin{bmatrix} 1 & 0 \\ 0 & \frac{- \left( {3 + {4i}} \right)}{5} \end{bmatrix}}.}}$ The x-axis rotation V₁=HV₃H and the y-axis rotation V₂=SV₁S^(†) are both Clifford-adjoints of V₃, where S is rotation around the z-axis by π, and H is the Hadamard gate.

The V basis was the first basis proven to be efficiently universal, meaning that the decomposition sequence is guaranteed to be of depth 0(log(1/ε)).

Two techniques are provided below for decomposing a single-qubit unitary into the V basis, which is an efficiently universal basis and which may have advantages over decomposing into the {H, T} basis, where H is the Hadamard gate and T is the π/8 gate. The techniques produce efficient quantum circuits that approximate a single-qubit unitary with high precision, and are computationally efficient in practice.

In addition, the techniques may be applied to Toffoli-based circuits. In some embodiments, the techniques may include first compiling into the V basis and subsequently replacing each V by a Toffoli-based circuit.

Discussed below are three possible exact constructions for implementations of a V gate on a given quantum computer architecture. Implementations of V gates could make decomposing into the V basis advantageous over decomposing into the {H,T} basis. However, it may be desired to determine an exact, fault-tolerant V gate implementation that costs less than the cost of 6 T gates (where the complete cost of a T gate could be determined, for example, based on a given state distillation protocol) so that the decomposition into the V basis is cost competitive with decomposing into the {H, T} basis.

It should be noted, at the onset, that although the current application employs mathematical notation and control-flow diagrams, the current application is directed to a method and system for producing physical, tangible, digital representations of quantum circuits that are stored in physical data-storage devices and systems, including optical disks within optical-disk drives, magnetic disks within magnetic-disk drives, electronic memories within computer systems, and other such physical, tangible data-storage devices. Furthermore, the quantum-circuit representations produced by methods and systems disclosed in the current application provide for the design of quantum circuits, the cost-effectiveness of which can be directly physically measured by the amount of data-storage-device capacity needed to store the quantum-circuit representations, by the cost in time and energy consumption in computing the representations for the quantum circuits, by the cost of implementing the quantum circuits programmatically or in hardware design, and by the time and energy consumed by the implemented quantum circuits. In other words, the current application is directed to real-world methods and systems of real-world utility that produce physical and physically measurable results.

Illustrative Environment

FIG. 1 is a schematic diagram of an example environment 100 for performing quantum calculations. The environment 100 includes a quantum computing system 102 and a non-quantum computing device 104. The non-quantum computing device 104 may be a digital computing system.

The quantum computing system 102 may include a quantum processor/memory 106 and input/output devices 108. The input/output devices 108 may include interferometers and other devices for, among other things, reading and setting states of qubits in the quantum processor/memory 106 and may include devices for interfacing with the non-quantum computing device 104.

The quantum processor/memory 106 may include topological quantum processor/memory 110, non-topological quantum processor/memory 112, quantum gates 114, and quantum bus 116. The topological quantum processor/memory 110 may include devices and components for providing topological based quantum computing, e.g., 5/2 quantum Hall systems and systems exhibiting Majorana modes such as, but not limited to, 1-dimensional or quasi 1-dimensional wires.

The non-topological quantum processor/memory 112 may include devices and components for providing non-topological based quantum computing. For example, the non-topological quantum processor/memory 112 may include devices such as, but not limited to, Josephson junctions for providing flux qubits, charge qubits, spin qubits, etc.

The quantum bus 116 may include devices and components for providing an interface between quantum processor/memory 106 and the input/output devices 108. The quantum bus 116 may include devices and components for providing an interface between qubits. For example, the quantum bus 116 may provide an interface between the topological quantum processor/memory 110 and the non-topological quantum processor/memory 112.

The quantum gates 114 may include various devices and components for performing various operations on qubit states. For example, quantum gates 114 may include devices and components for, among others, Hadamard gates, phase gates, unitary gates, controlled gates (e.g., controlled unitary gates), adder gates, and corresponding adjoint adder gates. The quantum gates 114 may be an efficiently universal set of gates in a basis set such as, but not limited to, the V basis.

The non-quantum computing device 104 may, among other things, interface with the input/output devices 108 to provide inputs (e.g., initial conditions of a problem to be solved by the quantum computing system 102) and receive outputs (e.g., measured quantum states). In some instances, the non-quantum computing device 104 may be simulate a quantum computing device and/or perform quantum calculations. In some instances, the non-quantum computing device 104 may decompose an initial quantum gate and/or initial quantum circuit and determine a sequence of quantum gates in a basis set of quantum gates that are equivalent, or equivalent to within a predetermined tolerance, of the initial quantum gate and/or initial quantum circuit. The basis set of quantum gates may be a universal set of quantum gates. As discussed herein below, the basis set of quantum gates may be, but is not limited to, a V basis set of gates.

Illustrative Quantum Gates

FIG. 2 shows a non-limiting embodiment of example quantum gates 114. The quantum gates 114 may include a basis set of gates 202. The basis set of gates 202 may be a universal set of gates—i.e., a set of gates with which any computation may be performed. As a non-limiting example, the basis set of gates 202 may be a V(5) basis set of gates denoted by: V ₁(5)=(I+2iX)/√{square root over (5)},V ₁ ^(†)(5)=(I−2iX)/√{square root over (5)}, V ₂(5)=(I+2iY)/√{square root over (5)},V ₂ ^(†)(5)=(I−2iY)/√{square root over (5)}, V ₃(5)=(I+2iZ)/√{square root over (5)},V ₃ ^(†)(5)=(I−2iZ)/√{square root over (5)}, where I, X, Y, and Z denote the Pauli matrices:

${I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}},{X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}},{Y = \begin{pmatrix} 0 & {- i} \\ i & 0 \end{pmatrix}},{and}$ $Z = {\begin{pmatrix} 1 & 0 \\ 0 & {- 1} \end{pmatrix}.}$

The above six unitaries {V_(i)(5), V_(i) ^(†)(5) i=1; 2; 3} provide a definition of the V(5) basis set. The subgroup (V)⊂SU(2) generated by the V(5) basis is everywhere dense in SU(2) and thus {Clifford gates, V_(i)(5), V_(i) ^(†)(5) i=1; 2; 3} is a universal basis.

However, it should be noted that there are other definitions of a V basis set. Other V basis sets such as, but not limited to, V(13) basis set, V(17) basis set, V(29) basis set, V(101) basis set, V(257) basis set and V(4097) basis set, while not discussed in detail, are included within the scope of this disclosure.

A unitary gate such as, but not limited to, a rotation gate may be decomposed and represented as a sequence of V gates. For example, the quantum gates 114 includes an exemplary rotation gate (R gate) 204, which provides a rotation about the z-axis by 0.1 radians. Expanded in the V(5) basis set of gates to a precision of 4.3×10⁻¹⁵, the 0.1 radian rotation about the z-axis is implemented by a sequence of 76 V(5) gates.

It should be remembered that the rotation gate 204 is an example of a gate implemented as a sequence of a basis set of gates and that in the quantum gates 114 may include other gates that are implemented sequences of the basis set of gates.

Example Quantum Circuits

FIG. 3 illustrates an example quantum circuit 300 for implementing a V₃(5) gate. The quantum circuit 300 includes two Toffoli gates 302, four Hadamard gates (H) 304, two measurement devices 306, an S gate 308, and a Pauli Z gate 310 and utilizes two ancillae qubits 312. The quantum circuit 300 is a V₃(5) gate to perform V₃(5)|ψ

when both measurement outcomes are zero (0), or |ψ

otherwise.

As shown in FIG. 3, the quantum circuit 300 (the V₃(5) gate) is made from “elemental gates,” which in this particular embodiment includes the Toffoli gates 302, the Hadamard gates (H) 304, the S gate 308, and the Pauli Z gate 310. In other embodiments, the V₃(5) gate may be made from elemental gates that are arranged differently than that shown in FIG. 3 and/or include different elemental gates and/or more or less elemental gates.

Although not shown, other gates of the V basis set are also made up of elemental gates.

In some instances, the quantum circuit 300 may be used in conjunction with protocols for distilling Toffoli states. For example, a given V gate can be approximated using a {H, T} decomposition, which may result in a circuit of length 70 or more, depending on the desired precision. However, two embodiments of exact implementations of the V₃(5) gate, which achieve perfect precision, are provided below.

In matrix form, a V₃(5) gate (V₃(5)=(I+2iZ)/√{square root over (5)}.) can be represented as:

${V_{3}(5)} = {{\frac{1}{\sqrt{5}}\begin{bmatrix} {1 + {2i}} & 0 \\ 0 & {1 - {2i}} \end{bmatrix}} = {\frac{1 + {2i}}{\sqrt{5}}\begin{bmatrix} 1 & 0 \\ 0 & \frac{- \left( {3 + {4i}} \right)}{5} \end{bmatrix}}}$

The other V_(i)(5) gates {V_(i)(5),V_(k) ^(†)(5) i=1, 2, and k=1; 2; 3} can then be implemented using V₃(5) and Clifford gates.

Implementing V₃ with Toffoli Gates

With probability 5/8, V₃(5) is applied to the target qubit |ψ

314, otherwise the identity is applied. The expected number of times this quantum circuit 300 must be repeated in order to result in the application of V₃(5) is 8/5, with an expected cost of 3.2 Toffolis.

In addition, a generalization to V₃(p_(i)) gates, where p₀=5, p₁=17, p₂=101, p₃=257, p₄=4097, . . . , can be implemented using a nested circuit based on FIG. 3, where the S gate 308 is replaced with V(p_(i-1)) for i>0. When i=0, the circuit is the same as in FIG. 3. The expected number of applications of the outermost circuit rapidly approaches 1 as p_(i) grows. For example, for V₃ (p_(i)) gates, where p₀=5, p₁=17, p₂=101, p₃=257, p₄=4097, the expectation is 8/5, 20/17, 104/101, 260/257, 4100/4097, respectively.

Implementing V₃ with State Distillation

Ignoring global phase, the angle of rotation θ about the z-axis invoked by V₃ is solved for using the following identity:

${\mathbb{e}}^{\mathbb{i}\theta} = {{{\cos\;\theta} + {i\;\sin\;\theta}} = {\left. \frac{- \left( {3 + {4i}} \right)}{5}\Rightarrow\theta \right. = {{\cos^{- 1}\left( {- \frac{3}{5}} \right)} \approx {4.06889.}}}}$

Consider the angle

$\theta^{\prime} = {{\cos^{- 1}\left( \frac{3}{5} \right)} \approx {0.927295.}}$ This angle is π away from θ:θ=θ′+π. Thus, to implement rotation R_(Z)(θ), one can implement the gate sequence R_(Z)(θ)=R_(Z)(θ′)R_(Z)(π), where R_(Z)(π) is the Pauli Z gate and

${\theta^{\prime} = {{2\theta_{2}} + \frac{\pi}{4}}},$ where 2θ₂ is the angle resulting from using the resource state e^(−iπ/8)HS^(†)|H₂

. The

$\frac{\pi}{4}$ part of the angle is a T=R_(Z)(π/4) gate, thus R_(Z)(θ′)=R_(Z)(2θ₂)T, and R_(Z)(θ)=R_(Z)(2θ₂)TZ.

FIG. 4 illustrates an example quantum circuit 400 that obtains a rotation of Z(2θ₂). The quantum circuit 400 results in the application of ±2θ₂ to |ψ

, each with equal probability. If m=0, then R_(Z)(2θ₂) has been applied. If m=1, R_(Z)(4θ₂) is applied.

The quantum circuit 400 includes a controlled Pauli X gate 402 and a measuring device 404, which measures a state |m

406 of the controlled Pauli X gate 402. The controlled Pauli X gate 402 is applied to an ancillary state 408 and the target qubit 314 is the control. In this illustrated example, the ancillary state 408 is given by e^(iπ/8)HS^(†)|H₂

, where |H₂

is a non-stabilizer ladder state.

FIG. 5 illustrates an example quantum circuit 500 that obtains ladder |H_(i)

states from initial resource states |H₀

. The quantum circuit 500 includes a controlled-NOT Pauli gate 502 and a measuring device 504. The quantum circuit 500 measures the parity of two input qubits, first qubit 506 and second qubit 508, and decodes the resulting state into the second qubit 508.

Let the first qubit 506 and second qubit 508 be magic states |H

and define

$\theta_{0} = {\frac{\pi}{8}\text{:}}$ |H

=|H ₀

=cos θ₀|0

+sin θ₀|1

.

Upon application of the controlled-NOT gate Λ(X),

Upon measurement m 510 of the first qubit 506 by measurement device 504, the state 512 of the second qubit 508 is given by:

Let θ₁ be defined such that

${{{\cos\;\theta_{1}\left. 0 \right\rangle} + {\sin\;\theta_{1}\left. 1 \right\rangle}} = \frac{{\cos\;\theta_{0}\left. 0 \right\rangle} + {\sin\;\theta_{0}\left. 1 \right\rangle}}{{\cos^{4}\theta_{0}} + {\sin^{4}\theta_{0}}}},$ it can be deduced that cot θ₁=cot² θ₀.

Thus, |H₁

=cos θ₁|0

+sin θ₁|1

, which is a non-stabilizer state obtained from |H

states, Clifford operations, and measurements.

If the measurement outcome 510 is 1, then a stabilizer state is obtained and the output is discarded. The measurement outcomes occur with respective probabilities

$p_{{m = 0},0} = {{{\cos^{4}\theta_{0}} + {\sin^{4}\theta_{0}}} = \frac{3}{4}}$ and $p_{{m = 1},0} = {{1 - p_{0}} = {\frac{1}{4}.}}$

Now consider the next step of the ladder. This protocol is recursive, using the non-stabilizer states produced by the previous round of the protocol as input to the quantum circuit 500. In this case, the recursion need only go to state |H₂

, which is defined as |H₂

=cos θ₂|0

+sin θ₂|1

, where cot θ₂=cot³ θ₀.

To obtain this state, the quantum circuit 500 receives as inputs, the previously produced |H₁

state and a new |H₀

state:

Upon measurement of the first qubit 506, the state 512 is given by:

where cot θ′=cot θ₁ cot θ₀=cot³ θ₀=cot θ₂, and where cot θ″=cot θ₁ tan θ₀=cot¹ θ₀=cot θ₀.

Thus, the state |H₂

is obtained by measuring m=0, and the state |H₀

is obtained by measuring m=1. The probability of measuring 0 is given by p _(m=0,1)=cos² θ₁ cos² θ₀+sin² θ₁ sin² θ₀.

It should be noted that

${{\frac{3}{4} \leq p_{{m = 0},i} < {\cos^{2}\frac{\pi}{8}}} = {0.853\mspace{11mu}\ldots}}\mspace{11mu},$ so the probability of obtaining |H₂

is far higher than the probability of obtaining |H₀

. Other Example V₃ Gates

FIG. 6 illustrates an example quantum circuit 600 for implementing a V₃(5) gate and may be a fault tolerant gate. The quantum circuit 600 includes four T (π/8) gates, individually referenced as 602 a-602 d and collectively referenced as 602, four Hadamard gates (H), individually referenced as 604 a-604 d and collectively referenced as 604, two measurement devices, individually referenced as 606 a-606 b and collectively referenced as 606, a Pauli Z gate 608, and two CNOT gates, individually referenced as 610 a-610 b and collectively referenced as 610. It should be noted that one of the T (π/8) gates 602 a is an adjoint denoted by T^(†). The quantum circuit 600 utilizes two ancillae qubits, individually referenced as 614 a-616 b and collectively referenced as 614, and is applied to a quantum state |ψ

614. The quantum circuit 600 is a V₃(5) gate to perform V₃(5)|ψ

when both measurement outcomes are zero (0), or |ψ

otherwise.

As shown in FIG. 6, the quantum circuit 600 (the V₃(5) gate) is made from “elemental gates,” which in this particular embodiment includes the T (π/8) gates 602, the Hadamard gates (H) 604, the Pauli Z gate 608, and the CNOT gates 610. In other embodiments, the V₃(5) gate may be made from elemental gates that are arranged differently than that shown in FIG. 6 and/or include different elemental gates and/or more or less elemental gates.

In the illustrated embodiment, the CNOT gate 610 a bridges ancillary qubit wires 616 a and 616 b, and the CNOT gate 610 b bridges ancillary qubit wire 616 b and computational qubit wire 618, where the ancillary wire 616 b is the control to the CNOT gate 610 a and the computational qubit wire 618 is the control to the CNOT gate 610 b.

On the ancillary qubit wire 616 a, operations are performed in the following order: Hadamard gate 604 a, T adjoint gate 602 a, CNOT gate 610 a, T gate 602 b, Hadamard gate 604 b, and measurement device 606 a.

On the ancillary qubit wire 616 b, operations are performed in the following order: Hadamard gate 604 c, CNOT gate 610 a, CNOT gate 610 b, T gate 602 c, Hadamard gate 604 d, and measurement device 606 b.

On the computational qubit wire 618, operations are performed in the following order: CNOT gate 610 b, Z gate 608, and T gate 602 d.

However, it should be noted that some of the gates in the quantum circuit 600 may commute. For example, T gates and Z gates commute, T gates and CNOT gates commute when the T is on the control qubit, and Z gates and CNOT gates commute when the Z is on the control qubit. Consequently, in some embodiments, the gates of the quantum circuit 600 may be arranged in a different sequence than that shown in FIG. 6, and the order of operations will be correspondingly altered, but such embodiments will provide quantum circuits that are equivalent to the quantum circuit 600.

Further, in some instances, gates of the quantum circuit 600 may be reordered, or commuted with each other, in different runs. For example, on odd number runs (e.g., first, third, etc.) the CNOT gate 610 b, Z gate 608, and T gate 602 d may be arranged in the sequence shown in FIG. 6, and on even number runs (e.g., second, fourth, etc.), the CNOT gate 610 b, T gate 602 d and Z gate 608 may be arranged (from left to right) T gate 602 d, Z gate 608, and then CNOT gate 610 b.

The Hadamard gates 604 a-604 c, the T gates 602 a, 602 b, the measurement device 606 a, and the CNOT gate 610 a comprise an ancillary state generator 620. In some instances, the ancillary state generator 620 may be implemented or prepared independent of the quantum state |ψ

614. For example, the ancillary state generator 620 may be prepared to be in a certain state (e.g., measurement device 606 a measures zero (0)) independent of the quantum state |ψ

614. For example, the ancillary state generator 620 can be run in an offline mode (e.g., before the quantum state |ψ

614 exists or before the quantum state |ψ

614 is received at the computational qubit wire 618). It should be noted that the quantum state |ψ

614 may decohere over time. Consequently, in some instances, it may be preferable to run the ancillary state generator 620 in offline mode so as to prepare a desired state (e.g., the measurement device 606 a measures zero (0)) before the quantum state |ψ

614 is received at the computational qubit wire 618 so as to prevent, or reduce, decoherence of the quantum state |ψ

614.

However, in some instances, the ancillary state generator 620 may be implemented or prepared in conjunction with the quantum state |ψ

614. The ancillary state generator 620 may be run in an online mode in conjunction with the quantum state |ψ

614.

In offline mode, the ancillary state generator 620 can be implemented as many times as is required to put the ancillary state generator 620 in the desired state without affecting the quantum state |ψ

614. For example, at the start of each run, the ancillary state generator 620 is provided with two ancillary qubits 614 in state |0

, and if the measurement device 616 a does not measure zero (0), the run is tossed out, and a new run (with fresh ancillary qubits 614 in state |0

) is commenced until the measurement device 616 a does measure zero (0). There is a 3/4 probability that the measurement device 606 a measures zero (0) and yields the desired state.

When the ancillary state generator 602 is run offline to ensure that the measurement device 606 a measures zero (0), there is a 5/6 probability that the measurement device 606 b will also measure zero (0). When the ancillary state generator 602 is run online and repeated to ensure that the measurement device 606 b will also measure (0), there is also a 5/6 probability that the measurement device 606 b will also measure (0). When both the measurement 616 a and measurement 616 b are performed irrespective of the measurement result 616 a, then there is an overall probability of 5/8 that both of the measurement devices 606 will measure zero (0). When the probability of success of measurement of 616 b is 5/6 given that measurement of 616 a is 0, the expected T count is approximately 5.26. Measure 616 b prior to applying 608 and 602 d on qubit 614. Given that measurement of 616 a has resulted in 0, then if a first attempt at measuring 616 b fails and results in measurement result 1 (with probability of 1/6), then wait to apply gate 608 and 602 d until the measurement result of the next attempt is known. In the next attempt, T gate 602 d and Z gate 608 are commuted through the CNOT 610 b (i.e., from left to right the sequence of the gates is T gate 602 d, Z gate 608, and CNOT gate 610 b). If a second attempt by the measurement device 616 b succeeds and results in measurement result 0, then the two T gates 602 d combine and result in an S gate. Similarly, the two Z gates 608 can be commuted with the S gate and combine to an I gate. Thus, if the total number of attempts is k, then the expected T gate cost is given by

${\left( {\left( {\frac{4}{3} \times 2} \right) + 1} \right)k} + {\left( {k\;{mod}\; 2} \right).}$ The probability that exactly k attempts are required is given by

$\left( \frac{5}{6} \right){\left( \frac{1}{6} \right)^{k - 1}.}$ Summing over k gives an expected T count of 5.26. It can be shown the T gate count is approximately 6.4 when the overall probability of success is 5/8 and the measurement of 616 a and 616 b are performed irrespective of the measurement result of 616 a.

When the measurement devices 606 measure zero (0), the desired unitary V₃(5) has been applied to the quantum state |ψ

614. However, when one or both of the measurement devices 606 measure one (1), the identity (I) gate is the result, up to a known Clifford gate conjugation. Since measurements of one (1) result in I|ψ

or |ψ

, up to a known Clifford gate conjugation, this result (|ψ

) can be looped back to the quantum circuit 600, repeatedly, until the measurements by the measurement devices 606 are zero (0). At which point, the desired unitary V₃(5) has been applied to the quantum state |ψ

614.

Illustrative Non-Quantum Computing Device

FIG. 7 shows an illustrative non-quantum computing device 104 that may be used in environment 100. It will readily be appreciated that the various embodiments described above may be implemented in other computing devices, systems, and environments. The non-quantum computing device 104 shown in FIG. 7 is only one example of a computing device and is not intended to suggest any limitation as to the scope of use or functionality of the computer and network architectures. The non-quantum computing device 104 is not intended to be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the example computing device.

In a very basic configuration, the non-quantum computing device 104 typically includes at least one processor 702 and system memory 704. The processor 702 is a non-quantum processing unit such as, for example, a conventional computer processor such as a digital processor. Depending on the exact configuration and type of computing device, the system memory 704 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.) or some combination of the two. The system memory 704 typically includes an operating system 706, one or more program modules 708, and may include program data 710. The computing device 104 is of a very basic configuration demarcated by a dashed line 712.

The program modules 708 may include instructions for, among other things, implementing simulations of quantum systems on the non-quantum computing device 104, providing control signals to the quantum computing system 102, and receiving data from the quantum computing system 102. In addition, the program modules 708 may include instructions for, implementing simulations of quantum calculations and/or simulating quantum computers.

The non-quantum computing device 104 may have additional features or functionality. For example, the computing device 104 may also include additional data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape. Such additional storage is illustrated in FIG. 7 by removable storage 714 and non-removable storage 716. Computer-readable media may include, at least, two types of computer-readable media, namely computer storage media and communication media. Computer storage media may include volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. The system memory 704, the removable storage 714 and the non-removable storage 716 are all examples of computer storage media. Computer storage media includes, but is not limited to, random-access-memory (RAM), read-only-memory (ROM), electrically erasable programmable ROM (EEPROM), flash memory or other memory technology, compact disk (CD), CD-ROM, digital versatile disks (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store the desired information and which can be accessed by the non-quantum computing device 104. Any such computer storage media may be part of the non-quantum computing device 104. Moreover, the computer-readable media may include computer-executable instructions that, when executed by the processor(s) 702, perform various functions and/or operations described herein.

In contrast, communication media embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave, or other transmission mechanism. As defined herein, computer storage media does not include communication media.

The non-quantum computing device 104 may also have input device(s) 718 such as keyboard, mouse, pen, voice input device, touch input device, etc. Output device(s) 720 such as a display, speakers, printer, etc. may also be included. These devices are well known in the art and are not discussed at length here.

The non-quantum computing device 104 may also contain communication connections 722 that allow the device to communicate, such as over a network, with other computing devices 724 including the quantum computing system 102. These networks may include wired networks as well as wireless networks. The communication connections 722 are one example of communication media.

The illustrated non-quantum computing device 104 is only one example of a suitable device and is not intended to suggest any limitation as to the scope of use or functionality of the various embodiments described. Other well-known computing devices, systems, environments and/or configurations that may be suitable for use with the embodiments include, but are not limited to personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-base systems, set top boxes, game consoles, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and/or the like.

The system memory 704 may also include Universal Gates module 726. The Universal Gates module 726 may include instructions for determining a replacement sequence of quantum gates. For example, the Universal Gates module 726 may receive a mathematical expression of an input/target quantum gate, decompose the input/target quantum gate, and determine the replacement sequence of quantum gates, where the replacement sequence of quantum gates is approximately equivalent to, or within a predetermined precision level of, the input/target gate, and where the replacement sequence of quantum gates is a sequence of universal gates such as V gates. The replacement gates may be stored in Universal Gates module 726 and/or in program data 710 or in other memory, e.g., removable storage 714 and/or non-removable storage 716.

It should be noted that the non-quantum computing device 104 stores and manipulates information represented as binary numbers, or digits, of various lengths.

Quantum Computing and Qubits

FIGS. 8A-D illustrate a quantum bit, referred to as a “qubit,” which is a fundamental data-storage unit of many quantum-computing systems. The qubit is a quantum-computing analog of a classical digital-computer-system bit. A classical bit is considered to occupy, at any given point in time, one of two possible states corresponding to the binary digits “0” and “1.” Of course, the classical bit is a high-level abstraction of a hardware implementation of the classical bit and, at the molecular level, the transistors and other circuit components and wiring that together compose a classical bit have an infinite number of quantum-mechanical states. Nonetheless, the complex quantum-mechanical states of a hardware implementation of a classical bit fall into two discrete and measureable subspaces that, in the aggregate, correspond to discrete and differentiable macroscopic states corresponding to binary digits “0” and “1.”

By contrast, a qubit is implemented in hardware by tiny, physical components with quantum-mechanical characteristics that are generally contained within macroscopic subsystems. These tiny physical components can have an infinite number of different quantum-mechanical states. When the state of a qubit is physically measured, the measurement produces one of two different basis states |0

and |1

. The quantum-mechanical state of a qubit is represented as a state vector representing a superposition of the two states |0

and |1

: |ψ

=α|0

+β|1

where α and β are complex numbers and |α|²+|β|²=1. The qubit state vector can be represented in vector notation as:

$\left. \psi \right\rangle = {\begin{bmatrix} \alpha \\ \beta \end{bmatrix}.}$

The choice of vector representations of the states |0

and |1

is somewhat arbitrary, but to facilitate mathematical operations, these two vectors are generally chosen to be orthonormal and are often assigned the vector representations:

$\left. 0 \right\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$ $\left. 1 \right\rangle = {\begin{bmatrix} 0 \\ 1 \end{bmatrix}.}$

The notation |

is, in the Dirac notation, referred to as the “ket” notation for vectors of an inner-product vector space. This inner-product vector space has a dual inner-product vector space, the vectors of which are represented by the Dirac bra notation

|. The corresponding dual-inner-product vector space vectors for the above-discussed qubit state vectors are:

ψ|=[α*,β*]

0|=[1,0]

1|=[0,1] where α* is the complex conjugate of α. The magnitude of a qubit state vector is computed as the square root of the inner product of the state vector and its corresponding dual state vector:

$\begin{matrix} {{\left\langle \psi  \right.} = \sqrt{\left\langle \psi \middle| \psi \right\rangle}} \\ {= \sqrt{{\alpha\alpha}^{*} + {\beta\beta}^{*}}} \\ {= 1.} \end{matrix}$ Thus, state vectors used to describe qubit states are normalized to have a magnitude of 1, which is indicated by the “normal” syllable of the term “orthonormal.” The “ortho” syllable refers to the fact that the state vectors |0

and |1

are chosen to be orthogonal, to simplify various operations, including taking inner products. Note that, by one convention, kets are represented by columns vectors and bras by row vectors. A complex row vector multiplied by a complex column vector, as in the above expression for the square root of the inner product of the state vector |ψ

, produces a real number, while a column vector multiplied by a row vector produces a generally complex-valued matrix.

The quantum-mechanical state |ψ

of a qubit is not directly observable by measurement. Instead, physical measurement operations are performed on a qubit to produce a measured state in a computational basis such as the basis |0

or |1

. The measurement operations can be represented as 2×2 matrices M₀ and M₁:

$M_{0} = {{\left. 0 \right\rangle\left\langle 0 \right.} = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}}$ $M_{1} = {{\left. 1 \right\rangle\left\langle 1 \right.} = {\begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}.}}$

The probability that a measurement of a qubit in state |ψ

will return a state |0

or |1

is obtained by the inner product: p _(m) =

ψ|M _(m) ^(†) M _(m)|ψ

where m is 0 or 1, corresponding to a measurement that produces |0

or |1

, respectively. For example, the probability p₀ that a measurement of the state of a qubit in state |ψ

produces |0

is obtained as:

$\begin{matrix} {p_{0} = \left\langle {\psi{{M_{0}^{\dagger}M_{0}}}\psi} \right\rangle} \\ {= {{\left\lbrack {\alpha^{*},\beta^{*}} \right\rbrack\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}}\begin{bmatrix} \alpha \\ \beta \end{bmatrix}}} \\ {= {\alpha\alpha}^{*}} \\ {= {{\alpha }^{2}.}} \end{matrix}$ By a similar computation: p ₁=|β|². Thus, the squares of the magnitudes of the coefficients α and β in the expression |ψ

=α|0

+β|1

correspond to the probabilities that a measurement of a qubit in state |ψ

will produce states |0

and |1

, respectively.

FIG. 8A shows a unit sphere 802 centered within a Cartesian coordinate system with orthonormal axes x 804, y 806, and z 808.

Referring to FIG. 8B, the z axis 808 is comprised of positive z axis 810 and negative z axis 812, and the surface of this unit sphere represents all of the possible qubit state vectors |ψ

814 with unit modulus, analogous to the circle of an Argand diagram, discussed below, that represents all possible complex numbers of unit modulus.

FIG. 8B shows an arbitrary unit vector 816 representing the qubit state vector |ψ

814 within the unit sphere 802. A vector of unit magnitude collinear with the positive z axis 410 is arbitrarily chosen to represent state vector |0

818 and the vector of unit magnitude collinear with the negative z axis 812 is chosen to represent state vector |1

820. Pairs of points at which a line passing through the origin intersects the unit sphere correspond to orthogonal state vectors. The arbitrary single-qubit state vector |ψ

814 is a linear combination of the two computational-basis state vectors |0

and |1

, as expressed by |ψ

=α|0

+β|1

, and can thus be any vector that can be inscribed within the unit sphere, with the particular vector corresponding to |ψ

814 depending on the values of α and β. The representation of the state of a qubit shown in FIG. 8B is referred to as a Bloch sphere.

FIG. 8C shows the Argand diagram frequently used to illustrate various ways to represent a complex number. The horizontal axis 822 represents the real numbers and the vertical axis 824 represents the imaginary numbers. The general expression for a complex number z is: z=a+ib where a and b are real numbers and i=√{square root over (−1)}. Because a=r cos θ b=r sin θ, as shown in FIG. 8C, the complex number z can be alternatively expressed in polar form as:

$\begin{matrix} {z = {r\left( {{\cos\;\theta} + {i\;\sin\;\theta}} \right)}} \\ {= {r\;{\mathbb{e}}^{{\mathbb{i}}\;\theta}}} \\ {= {{\mathbb{e}}^{{\mathbb{i}}\;\theta}\mspace{14mu}{for}\mspace{14mu}{r}}} \\ {= {1..}} \end{matrix}$

FIG. 8D shows a complete representation of the Bloch sphere for the arbitrary state vector |ψ

814. The unit vector 816 representing the qubit state vector |ψ

814 can be specified with two angles θ 826 and φ 828. Using the polar form for the complex coefficients α and β, state vector |ψ

can be expressed as: |ψ

=r _(α) e ^(iφ) ^(α) |0

+r _(β) e ^(iφ) ^(β) |1

As previously discussed the squares of the magnitudes of the coefficients α and β correspond to the probabilities that a measurement of a qubit in state |ψ

814 will return state vectors |0

818 and |1

820, respectively. The state vector |ψ

814 can be multiplied by an arbitrary complex number with unit modulus, e^(iα), without changing the magnitudes of the squares of the coefficients α and β, as shown by: e ^(iγ) |ψ

=e ^(iγ) r _(α) e ^(iφ) ^(α) |0

+e ^(iγ) r _(β) e ^(iφ) ^(β) |1

, |e ^(iγ) r _(α) e ^(iφ) ^(α|) ² =e ^(iγ) r _(α) e ^(iφ) ^(αe) ^(−iγ) r _(α) e ^(−iφ) ^(α=r) _(α) ²=|α| |e ^(iγ) r _(β) e ^(iφ) ^(β|) ²=|β|². Thus, there is a global phase-shift degree of freedom in the expression of a state vector that does not affect the measureable properties associated with the state.

The state vector |ψ

814 can alternately be expressed, using the Bloch-sphere angles shown in FIG. 8D, as:

$\left. \psi \right\rangle = {{\cos\frac{\theta}{2}\left. 0 \right\rangle} + {{\mathbb{e}}^{{\mathbb{i}}\;\varphi}\sin\frac{\theta}{2}{\left. 1 \right\rangle.}}}$ A derivation of this expression from the previously presented expression |ψ

=r_(α)e^(iφ) ^(α) |0

+r_(β)e^(iφ) ^(β) |1

, for the state vector |ψ

follows:

$\begin{matrix} {{{{\mathbb{e}}^{{\mathbb{i}}\;\varphi_{\alpha}}\left. \psi \right\rangle} = {{{\mathbb{e}}^{{\mathbb{i}}\;\varphi_{\alpha}}r_{\alpha}{\mathbb{e}}^{{\mathbb{i}}\;\varphi_{\alpha}}\left. 0 \right\rangle} + {{\mathbb{e}}^{{\mathbb{i}}\;\varphi_{\alpha}}r_{\beta}{\mathbb{e}}^{{\mathbb{i}\varphi}_{\beta}}\left. 1 \right\rangle}}},} \\ {= {{r_{\alpha}\left. 0 \right\rangle} + {r_{\beta}{\mathbb{e}}^{{\mathbb{i}}{({\varphi_{\beta} - \varphi_{\alpha}})}}\left. 1 \right\rangle}}} \\ {{= {{r_{\alpha}\left. 0 \right\rangle} + {r_{\beta}{\mathbb{e}}^{{\mathbb{i}}\;\varphi}\left. 1 \right\rangle}}},} \end{matrix}$ ${\left. \psi \right\rangle = {{r_{\alpha}\left. 0 \right\rangle} + {r_{\beta}{\mathbb{e}}^{{\mathbb{i}}\;\varphi}\left. 1 \right\rangle}}},{x = {r\;\sin\;\theta\;\cos\;\varphi}},{y = {r\;\sin\;\theta\;\sin\;\varphi}},{z = {r\;\cos\;\theta}},{r = 1},\left. r_{\alpha}\rightarrow z \right.,{\left. \psi \right\rangle = {{\cos\;\theta\left. 0 \right\rangle} + {{\mathbb{e}}^{{\mathbb{i}}\;\varphi}\sin\;\theta\left. 1 \right\rangle}}},{\theta^{\prime} = {2\;\theta}},{\left. \psi \right\rangle = {{{\cos\left( \frac{\theta^{\prime}}{2} \right)}\left. 0 \right\rangle} + {{\mathbb{e}}^{\mathbb{i}\varphi}{\sin\left( \frac{\theta^{\prime}}{2} \right)}{\left. 1 \right\rangle.}}}}$ The derivation uses a global phase factor to remove a phase coefficient from one of the terms and then employs spherical coordinate representations of the orthonormal axes x, y, and z as well as several substitutions to produce the final expression.

In the current discussion, a qubit is treated as a mathematical object with the above-described properties. However, these mathematically-described qubits correspond to actual physical hardware qubits that can be implemented using a number of different physical implementations, including trapped ions, optical cavities, and individual elementary particles, molecules, or aggregations of molecules that exhibit qubit behavior.

Various different primitive operations, corresponding to logic circuits in a digital computer and to computer instructions that control operation of logic circuits, can be performed on classical bits to produce classical bits with possibly altered state values. These primitive operations are referred to as “gates,” e.g., quantum gates 114. (See, FIG. 1.) For example, when a signal corresponding to the state of a first classical bit is passed through a digital NOT gate and stored in a second classical bit, the state of the second classical bit is opposite from the state of the first classical bit. In fact, the digital NOT gate is the only fundamental, non-trivial, traditional, classical computing gate with a single-bit input and a single-bit output. By contrast, there are an infinite number of possible single-qubit quantum gates that change the state vector of a qubit. As can be seen in FIG. 8D, changing the state of a qubit essentially involves changing the direction of the state vector or, in other words, selecting a new direction for the state vector from among an infinite number of directions. Changing the state of a qubit state vector is therefore referred to as a “rotation.” A rotation, state change, or single-qubit quantum-gate operation is represented mathematically by a unitary 2×2 matrix with complex elements:

$\quad\begin{bmatrix} a & {{- \lambda}\; b^{*}} \\ b & {\lambda\; a^{*}} \end{bmatrix}$ where the notation “x*” indicates the complex conjugate of x, |λ|=1 and |a|²+|b|²=1. A unitary 2×2 matrix X with complex elements can be defined as a 2×2 matrix X with the following property:

${X^{\dagger}X} = {{XX}^{\dagger} = {I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}}}$ where

$X^{\dagger} = {\begin{bmatrix} a^{*} & b^{*} \\ {{- \lambda^{*}}b} & {\lambda^{*}a} \end{bmatrix}.}$

The adjoint X^(†) of a unitary matrix X is the conjugate transpose of the unitary X. The fact that multiplication of the adjoint unitary operation by the unitary operation, or vice versa, produces the identity operator Id, or identity matrix I, can be seen by:

$\begin{matrix} {\begin{bmatrix} a^{*} & b^{*} \\ {{- \lambda^{*}}b} & {\lambda^{*}a} \end{bmatrix} = \begin{bmatrix} a & {{- \lambda}\; b^{*}} \\ b & {\lambda\; a^{*}} \end{bmatrix}} \\ {= \begin{bmatrix} {{aa}^{*} + {b^{*}b}} & {{{- \lambda}\; a^{*}b^{*}} + {\lambda\; a^{*}b^{*}}} \\ {{{- \lambda^{*}}{ab}} + {\lambda^{*}{ab}}} & {{{\lambda\lambda}^{*}{aa}^{*}} + {{\lambda\lambda}^{*}b^{*}b}} \end{bmatrix}} \\ {= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}} \end{matrix}$ since λλ*=|λ|²=1 and a*a+bb*=|a| ² +|b| ²=1. Thus, the operation of a quantum gate on a qubit with state |ψ

, where |ψ

is expressed in vector form as

${\left. \psi \right\rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix}},$ can be expressed as left-hand multiplication of the state vector by the unitary matrix corresponding to the unitary operation:

${\begin{bmatrix} a & {{- \lambda}\; b^{*}} \\ b & {\lambda\; a^{*}} \end{bmatrix}\begin{bmatrix} \alpha \\ \beta \end{bmatrix}} = {\begin{bmatrix} {{a\;\alpha} - {\lambda\; b^{*}\beta}} \\ {{b\;\alpha} + {\lambda\; a^{*}\beta}} \end{bmatrix} = {\begin{bmatrix} \alpha^{\prime} \\ \beta^{\prime} \end{bmatrix}.}}$

FIG. 9 illustrates a quantum circuit 900 comprising two quantum gates, unitary operation X 902 and unitary operation Y 904. In FIG. 9, a qubit 906 in a first state |ψ

908, represented by the Bloch sphere 910, is transformed by the unitary operation X 902 such that the qubit 906 is in a state |ψ₂

912, as represented by Bloch sphere 914. The second unitary operation Y 904 to places the qubit 906 in a state |ψ

916, as represented by Bloch sphere 918. This quantum circuit 900 can be represented as the gate sequence XY which transforms the qubit as follows:

$\left. {\overset{X}{\begin{bmatrix} X_{11} & X_{12} \\ X_{21} & X_{22} \end{bmatrix}}\overset{\psi_{1}\rangle}{\begin{bmatrix} \alpha_{1} \\ \beta_{1} \end{bmatrix}}}\rightarrow\begin{bmatrix} {{X_{11}\alpha_{1}} + {X_{12}\beta_{1}}} \\ {{X_{21}\alpha_{1}} + {X_{22}\beta_{1}}} \end{bmatrix} \right. = \overset{= {\psi_{2}\rangle}}{\begin{bmatrix} \alpha_{2} \\ \beta_{2} \end{bmatrix}}$ $\left. {\overset{Y}{\begin{bmatrix} Y_{11} & Y_{12} \\ Y_{21} & Y_{22} \end{bmatrix}}\overset{\psi_{2}\rangle}{\begin{bmatrix} \alpha_{2} \\ \beta_{2} \end{bmatrix}}}\rightarrow\begin{bmatrix} {{Y_{11}\alpha_{2}} + {Y_{12}\beta_{2}}} \\ {{Y_{21}\alpha_{2}} + {Y_{22}\beta_{2}}} \end{bmatrix} \right. = {\begin{bmatrix} {{Y_{11}\left( {{X_{11}\alpha_{1}} + {X_{12}\beta_{1}}} \right)} + {Y_{12}\left( {{X_{21}\alpha_{1}} + {X_{22}\beta_{1}}} \right)}} \\ {{Y_{21}\left( {{X_{11}\alpha_{1}} + {X_{12}\beta_{1}}} \right)} + {Y_{22}\left( {{X_{21}\alpha_{1}} + {X_{22}\beta_{1}}} \right)}} \end{bmatrix} = \overset{= {\psi_{3}\rangle}}{\begin{bmatrix} \alpha_{3} \\ \beta_{3} \end{bmatrix}}}$ Alternatively, one can multiply the two matrices representing operations X and Y together to produce matrix Z, and then left-hand multiply state vector |ψ

by Z to produce the same result:

${\overset{X}{\begin{bmatrix} X_{11} & X_{12} \\ X_{21} & X_{22} \end{bmatrix}}\overset{Y}{\begin{bmatrix} Y_{11} & Y_{12} \\ Y_{21} & Y_{22} \end{bmatrix}}} = \overset{Z}{\begin{bmatrix} {{X_{11}Y_{11}} + {X_{12}Y_{21}}} & {{X_{11}Y_{12}} + {X_{12}Y_{22}}} \\ {{X_{21}Y_{11}} + {X_{12}Y_{21}}} & {{X_{21}Y_{12}} + {X_{22}Y_{22}}} \end{bmatrix}}$ ${\overset{Z}{\begin{bmatrix} {{X_{11}Y_{11}} + {X_{12}Y_{21}}} & {{X_{11}Y_{12}} + {X_{12}Y_{22}}} \\ {{X_{21}Y_{11}} + {X_{22}Y_{11}}} & {{X_{21}Y_{12}} + {X_{22}Y_{22}}} \end{bmatrix}}\overset{\psi_{1}\rangle}{\begin{bmatrix} \alpha_{1} \\ \beta_{1} \end{bmatrix}}} = {\begin{bmatrix} {{\alpha_{1}\left( {{X_{11}Y_{11}} + {X_{12}Y_{21}}} \right)} + {\beta_{1}\left( {{X_{11}Y_{12}} + {X_{12}Y_{22}}} \right)}} \\ {{\alpha_{1}\left( {{X_{21}Y_{11}} + {X_{22}Y_{21}}} \right)} + {\beta_{1}\left( {{X_{21}Y_{12}} + {X_{22}Y_{22}}} \right)}} \end{bmatrix} = {\overset{= {\psi_{3}\rangle}}{\begin{bmatrix} \alpha_{3} \\ \beta_{3} \end{bmatrix}}.}}$

A quantum circuit can therefore be specified as a sequence of quantum gates in which the quantum gates are symbolically represented or, equivalently, numerically represented. (It should also be noted that a single quantum gate may be specified as a sequence of quantum gates.) There are several ways to look at a quantum circuit. One can, as discussed above, multiply the matrices corresponding to the component quantum gates together in the order specified by the symbol sequence to produce a final, resultant, 2×2 complex matrix that represents the same state change, in a single operation or quantum gate, corresponding to the state change produced by sequential application of the quantum gates specified in the original symbol sequence. A quantum circuit can be viewed as a design for an actual hardware circuit in a quantum computer, where the hardware circuit needs to perform the operation specified by the single-gate representation of the quantum circuit, or can be viewed as a quantum-computing program, in which operations corresponding to the sequence of quantum gates represented by the symbol sequence are applied to a qubit in order to produce a final qubit state.

The term “quantum circuit” is thus somewhat interchangeable with the term “quantum gate,” as a quantum circuit can be expressed as a resultant operator. However, symbolically represented quantum circuits are useful in quantum circuit design for many reasons, including the fact that it is quite difficult to design and implement arbitrary physical quantum gates, but far easier to design and implement certain standard quantum gates, several of which are shown below. A symbolic representation using implementable quantum gates can thus represent a feasible design for hardware or a control program that produces the result that would be produced by the quantum-gate resultant obtained by multiplying the sequence of standard quantum gates. In addition, quantum circuits symbolically represented as sequences of standard gates do not necessarily map with uniform density to the set of arbitrary quantum gates, and finding a standard-gate implementation working back from a desired quantum gate is generally not a computationally tractable problem.

V Gate Basis Set and Decomposition Techniques

In the following discussing V basis is a generalization and refers to all V(p_(i)) bases (e.g., V(5), V(13), etc.).

Given that the V basis is efficiently universal, it is natural to consider constructing efficient decomposition techniques for it. In addition, there have been advances in fault-tolerant implementations of the V gates. A protocol for distillation of non-stabilizer states allows a V gate to be implemented by way of T gates. Alternatively, a V gate may be implemented utilizing the quantum circuit 300 (see FIG. 3) in conjunction with protocols for distilling Toffoli states. Example techniques are discussed in detail below for efficiently compiling quantum circuits into the V basis. In some instances, the number of non-Clifford V gates is minimized due to their high implementation costs.

One first non-limiting example technique approximates single-qubit unitaries over the set consisting of the V basis and the Clifford group. A second non-limiting example technique approximates single-qubit unitaries over the set consisting of the V basis and the Pauli gates. The first technique employs randomization, runs in expected polynomial time and delivers ε-approximations with V count ≦12 log₅(2/ε), where ε is a measure of precision. The second technique employs direct search and produces ε-approximations with V count≦3 log₅(1/ε) for most single-qubit unitaries, and approximations with V count 4 log₅(2/ε) for edge cases. The compilation time for the second technique is linear in 1/ε and thus exponential in log(1/ε). However, despite being exponential in log(1/ε), the second technique may still be utilized to find quantum circuits. For example, in some instances, the second technique has been utilized to find quantum circuits of length L=28 at precision level ε=3*10⁻⁷ with merely 1 minute of classical CPU time and modest space usage.

In the case of both the {H,T} basis and the V basis, the non-Clifford gates cannot be implemented fault-tolerantly in a purely unitary fashion. State-of-the-art fault-tolerant implementations of T are typically based on state distillation, which involves use of measurement, classical feedback, and ancillae qubits, or in some situations, the fault-tolerant implementations of T may be implemented directly by hardware comprised of quantum circuits. Similarly, existing fault-tolerant implementations of the V gates also involve measurement, classical feedback, and ancillae qubits. In both cases, efficient fault-tolerant methods continue to be developed and optimized. For this reason, the decomposition techniques are “costed” in terms of the number of non-Clifford gates. A fine-grained cost comparison can then be determined based on a chosen fault-tolerant implementation or device architecture.

Preliminaries

Let the set of W circuits be the set of those circuits generated by the V basis and the Pauli matrices I, X, Y, Z. It should be noted that the monoid

W

=

X, Y, Z, V1, V2, V3

⊂SU(2) contains all of the {V_(i) ⁻¹, i=1, 2, 3} and thus is in fact a subgroup of SU(2) containing

V

.

It should be further noted that the Pauli operators are a staple of any quantum computing architecture and can be implemented fault tolerantly at a very low resource cost in comparison to a non-Clifford group gate. It is also noted that the single-qubit Clifford group C in combination with any of the six V matrices generates a monoid

C+V

⊂SU(2) that is in fact a group, containing (W).

For the purposes of this disclosure, the number of V gates of a quantum circuit is called the V-count of that quantum circuit and is labeled as V_(c). It can be shown that an irreducible W quantum circuit contains at most one non-identity Pauli gate. Thus, if v is the V-count of such a circuit, then the overall depth of the circuit is either v or v+1.

A quantity called the trace distance is used to measure the distance between two unitaries U, VεPSU(2) and is given by: dist(U,V)=√{square root over (1−|tr(UV ^(†))|/2)}.  (1) The trace distance between a target unitary gate and the approximating unitary as precision ε.

While it has been shown that any single-qubit unitary can be approximated to a given precision ε by a V circuit of depth

${O\left( {\ln\left( \frac{1}{\varepsilon} \right)} \right)},$ no algorithm for actual synthesis of the approximating/replacement quantum circuits has yet been shown. In the present disclosure, effective techniques for synthesizing W-circuit approximations of single-qubit unitaries are developed.

The techniques may be based on the following theorem:

Theorem 1. A single-qubit unitary gate U can be exactly represented as a W circuit of V count V_(c)≦L if and only if it has the form U=(aI+biX+ciY+diZ)5^(−L/2),  (2) where a, b, c, d are integers such that a²+b²+c²+d²=5^(L).

Theorem 1 follows from Theorem 2 given below, which also gives rise to a simple constructive procedure for synthesizing a W circuit that represents such a U.

The following proof begins by sketching a linear-time technique for exact W-circuit synthesis that employs arithmetic of Lipschitz quaternions. More specifically, consider the group W of quaternions generated by ±1,±i,±j,±k,1±2i,1±2j,1±2k.  (3)

Then the following holds:

Theorem 2. (1) W is equal to the set of Lipschitz quaternions with norms 5^(L), (Lε

, L≧0). (2) Consider the group W₁={w/√{square root over (norm(w)|wεW)}}. Then the subgroup of gates in PSU(2) representable as exact W-circuits is isomorphic to the central quotient W₁/Z(W₁) where Z(W₁)=

₂={1,−1}.

Proof.(1) Recall that the quaternion norm is multiplicative and that ±1, ±i, ±j, ±k are the only Lipschitz quaternions of norm 1. Thus statement (1) is true for L=0.

The following is a proof for L=1: Let q=a+bi+cj+dk, a, b, c, dε

and norm(q)=a²+b²+c²+d²=5, which may be referred to as a unitarity condition.

Decompositions of 5 into sums of squares of four integers are easily enumerated and exactly two of the coefficients in the list {a,b,c,d} are zero, exactly one is ±1, and exactly one is ±2.

If a=±1, then it is observed that q is equal to one of 1±2i, 1±2j, 1±2k, −(1±2i), −(1±2j), −(1±2k) and thus belongs to W.

If one of b, c, d is ±1, the proof is reduced to the previous observation by multiplying q times one of i, j, k.

For example, if c=±1, then the real part of −jq is equal to c=±1.

Consider now a quaternion q with norm(q)=5^(L), L≧1.

Let q=p₁ . . . p_(m) be a prime quaternion factorization of q. Since 5^(L)=norm(q)=norm(p₁) . . . norm(p_(m)), for each i=1, . . . m the norm(p_(i)) is either 5 or 1. As shown above (considering L=0, 1), in either case p_(i)εW.

(2) Effective homomorphism h of W₁ onto the W-circuits is the multiplicative completion of the following map: i→iX j→iY k→iZ (1±2i)/√{square root over (5)}→(1±2iX)/√{square root over (5)} (1±2j)/√{square root over (5)}→(1±2iY)/√{square root over (5)} (1±2k)/√{square root over (5)}→(1±2iZ)/√{square root over (5)}

The correctness of this definition of homomorphism h is verified by direct comparison of multiplicative relations between the generators of W₁ and g(W)={iX, iY, iZ, (1±2iX)/√{square root over (5)}, (1±2iY)/√{square root over (5)}, (1±2iZ)/√{square root over (5)}}. These relations happen to be identical.

Effective homomorphism h is an epimorphism since all of the generators g(W) of the W-circuits group are by design in its image.

The characterization of Ker(h) is derived from representation of quaternions as orthogonal rotations of the 3-dimensional Euclidean space.

The units i, j, k may be arbitrarily mapped into vectors of an orthonormal basis in the Euclidean space and the corresponding basis vectors are labeled e(i), e(j), e(k). For a quaternion with zero real part p=bi+cj+dk, e(p)=b*e(i)+c*e(j)+d*e(k).

Let H₁ be the group of quaternions of norm 1 and g: H₁→SO(3) be the representation defined as g(q)[e(b)]=e(q*b*q⁻¹).

It is known that g(q) is an orthogonal rotation; g is a representation of the group of quaternions of norm 1 and that the kernel of this representation is the cyclic group

₂={1, −1}.

The group of quantum gates PSU(2) also has a standard orthogonal representation stemming from its adjoint representation on the Lie algebra psu(2)=su(2)=so(3). More specifically if psu(2) is regarded as the algebra of zero-trace Hermitian matrices then ad: PSU(2)→Aut(psu(2)), where Aut is the automorphism, is ad(u)[m]=u m u⁻¹.

The adjoint representation for PSU(2) is faithful.

If the above homomorphism h is regarded as the homomorphism h: W₁→PSU(2) then it is immediate that ad h=g on W₁. Since ad is faithful, i.e., injective, the kernel of h coincides with Ker(g)=Z(W₁)=(

)₂={−1,1}. (Q.E.D.)

Lipschitz quaternions form a division ring, and in view of Theorem 2, a quaternion with norm equal to 5^(L) can be decomposed into a product of generators in equation 3 in L trial division steps.

Pseudo code for an example decomposition technique is as follows, with input being a Lipschitz quaternion q of norm 5^(L):

(1) Initialize q and let ret ← empty list (2) while norm(q) > 0 do (3) find d in {1 ± 2i, 1 ± 2j, 1 ± 2k} such that d divides q (4) ret ← {d} + ret (5) q ← q/d //divides norm(q) by 5 (6) end while (7) if q ≠ 1 then (8) ret ← q + ret (9) end if (10) return ret

Now, given a unitary U as described in Thm 1, it is associated with the quaternion q=a+bi+cj+dk that has norm 5^(L) and thus belongs to the subgroup W. The factorization of q in the basis given in equation 3 is translated into a factorization of U in the W basis. Thus, the approximation of a target unitary gate G by a W quantum circuit is constructively reduced to approximating G with a unitary U described in Thm 1.

Techniques for decomposing single-qubit unitaries into a circuit in the set

+V

, where

is the set of single-qubit Clifford gates and V is one of the V gates, are discussed below.

Example Approximation/Replacement Quantum Gate Technique

FIG. 10 is a flow diagram of an illustrative process 1000 for determining a replacement sequence of universal quantum gates (e.g., V gates). The process 1000 and other processes discussed hereinbelow are, or may be, illustrated as a collection of blocks in a logical flow graph, which represent a sequence of operations that can be implemented in hardware such as, but not limited to, non-quantum computing devices (e.g., digital computers), quantum devices (e.g., quantum computing systems) and/or a combination thereof, software/algorithms for non-quantum computing devices and/or quantum devices, or a combination hardware and software/algorithm(s). In the context of software/algorithms, the blocks represent computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the recited operations. Generally, computer-executable instructions include routines, programs, objects, components, data structures, and the like that perform particular functions or implement particular abstract data types. The order in which the operations are described is not intended to be construed as a limitation, and any number of the described blocks can be combined in any order and/or in parallel to implement the process(es).

At 1002, a circuit depth L or precision ε is determined.

At 1004, a unitary quantum circuit of a target quantum circuit is determined. The unitary quantum circuit has the predetermined circuit depth L or precision ε.

At 1006, the unitary form of the unitary quantum circuit is expressed as or converted into a quaternion form having a specific structure. For example, the following mapping may be utilized to convert back and forth between quaternion form and unitary form for the V(5) basis set. i→iX j→iY k→iZ (1±2i)/√{square root over (5)}→(1±2iX)/√{square root over (5)} (1±2j)/√{square root over (5)}→(1±2iY)/√{square root over (5)} (1±2k)/√{square root over (5)}→(1±2iZ)/√{square root over (5)}

At 1008, the quaternion form is factorized to produce a list/sequence of irreducible quaternions factors. The factorization is determined based at least in part on the predetermined circuit depth L or precision ε.

At 1010, each quaternion of the list/sequence of quaternions is then mapped back into a unitary (e.g., a quantum gate of the V(5) basis set) to produce the replacement quantum circuit.

Techniques for determining a unitary quantum circuit of a target quantum gate are provided below. In one embodiment, a randomization technique is employed to decompose single-qubit unitaries into a circuit in the set

+V

, where

is the set of single-qubit Clifford gates and V is one of the V gates. In another embodiment, a direct search technique is employed to single-qubit unitaries into a circuit in the set

+V

, where

is the set of single-qubit Pauli gates and V is one of the V gates.

Randomization Approximation Technique

The following technique is based on a conjecture. The conjecture is presented for a general prime p=1 mod 4. However, the techniques discussed herein may, in some instances, be applied for p=5, and in such instances, the conjecture to be true only for p=5.

Conjecture 1 Consider N=p^(L), where p is a fixed integer prime number with p=1 mod 4 and L is a large even integer. For a constant Δ>1, let the four-square decomposition set s₄(N), the geometric ring R(N, Δ), and the circular segment A(N, Δ, P₊) be defined as above. Let Pr_(x,y)(s₄(N)) be the projection of the s₄(N) onto its first two coordinates. Then card(Pr _(x,y)(s ₄(N))∩R(N,Δ))=Ω(p ^(L/2) /√{square root over (L)})  (1) and card(Pr _(x,y)(s ₄(N))∩A(N,Δ,P ₊))=Ω(p ^(L/4) /√{square root over (L)})  (2)

The technique begins by approximating an arbitrary Z-rotation with a

+V

quantum circuit. The following technique works well in practice for ε<2*5⁻⁴=0.0032.

Problem 1 Given a Z-rotation G=R_(Z)(θ) and a small enough target precision ε, synthesize a

+V

circuit c(G, ε) such that dist(c(G,ε)<ε  (4) and V _(c)(c(G,ε)))≦4 log₅(2/ε)).  (5)

Theorem 3 There exists a randomized algorithm that solves Problem 1 in expected time polynomial in log(1/ε).

Geometry that relates Thm 3 to Conjecture 1 for p=5 is presented below. The goal is to select the target circuit depth value L such that ε<2*5^(−L/4).  (6)

Having found the smallest integer L satisfying equation 6, G is represented as

$G = {{{\cos\left( \frac{\theta}{2} \right)}I} + {i\;{\sin\left( \frac{\theta}{2} \right)}Z}}$ and G is approximated with U=(aI+biX+ciY+diZ5−L/2, as suggested by Thm 1.

Approximating G to precision ε in the trace distance metric is equivalent to finding U such that

${\left( {{a\;{\cos\left( \frac{\theta}{2\;} \right)}} + {d\;{\sin\left( \frac{\theta}{2} \right)}}} \right)5^{{- L}/2}} > {1 - {ɛ^{2}.}}$

Without loss of generality, it suffices to prove the theorem for −π/2<θ<π/2 since the target gate can be rotated to a position within this interval using R_(Z)(±π/2) rotations from the Clifford group. Further, the selection of L ensures that 5^(L/4)ε˜2.

Denote by A_(ε)(θ) the segment of the unit disk where

$\left( {{x\;{\cos\left( \frac{\theta}{2} \right)}} + {y\;{\sin\left( \frac{\theta}{2} \right)}}} \right) > {1 - {ɛ^{2}.}}$ Let D(L) be an isotropic dilation of the plane with coefficient 5^(L/2). Then the area of D(L)[A_(ε)(θ)] is

${{??}\left( {{D(L)}\left\lbrack {A_{ɛ}(\theta)} \right\rbrack} \right)} = {{5^{L}\frac{4\sqrt{2}}{3}ɛ^{3}} \sim {8\frac{4\sqrt{2}}{3}{5^{L/4}.}}}$

Define the angle φ=√{square root over (2)}ε(1−ε²/4) and the interval

${I_{w}\left( {ɛ,\theta} \right)} = \left( {5^{L/2}{\sin\left( {{\frac{\theta}{2} - \phi},{{5{L/2}\;\sin\;\theta\; 2} + \phi}} \right.}} \right.$ with subinterval 5L/2 sin θ2−ε,5L/2 sin θ2+ε.

The length of the latter is approximately

${2*5^{L/2}{\cos\left( \frac{\theta}{2} \right)}ɛ} \geq {2\sqrt{2}*5^{L/4}}$ and it contains approximately at least as many integer values.

Given any integer a such that

${{5^{L/2}{\sin\left( {\frac{\theta}{2} - ɛ} \right)}} < a < {5^{L/2}{\sin\left( {\frac{\theta}{2} + ɛ} \right)}}},$ it can be geometrically derived that the intersection of the horizontal line w=a with D(L)[A_(ε)(θ)] is a straight line segment that is longer than

${5^{L/2}\frac{ɛ^{2}}{2}} \geq 2$ and that it contains at least two integer grid points.

The theorem may now be proved.

Proof. As discussed above, the set of all representations of 5^(L) is a sum of squares of four integers s₄(5^(L))={(x, y, z, w)ε

⁴|x²+y²+z²+w²=5^(L)}.

The key step in this proof is finding a point (a, d) in the intersection of Pr_(x,y)(s₄(5^(L))) and D(L)[A_(ε)(θ)]. Once such a point is found, a Rabin-Shallit algorithm may be used to express 5^(L)−a²−d² as b²+c², b, cε

. Then U=(aI+biX+ciY+diZ)5^(−L/2) would be the desired approximation of G, and can be represented precisely as a W circuit in at most L quaternion division steps.

Consider a horizontal line w=α, where αεI_(w)(ε, θ). By geometric calculation it is found that the intersection of this line with the D(L)[A_(ε)(θ)] segment is a line segment that is at most

${5^{L/2}{ɛ^{2}/{\cos\left( \frac{\theta}{2} \right)}}} \leq {5^{L/2}\sqrt{2}ɛ^{2}}$ long.

For this choice of L this maximum length is approximately 4√{square root over (2)} and thus the line segment contains at most 5 points with an integer first coordinate. On the other hand, it was shown earlier that for

${5^{L/2}{\sin\left( {\frac{\theta}{2} - ɛ} \right)}} < a < {5^{L/2}{\sin\left( {\frac{\theta}{2} + ɛ} \right)}}$ the intersection of the w=a line with D(L)[A_(ε)(θ)] is a line segment that is longer than 2 and must contain at least 2 points with integer z coordinate. In other words, if aεI_(w)(ε, θ) is a randomly selected integer, then with probability at least 1/√{square root over (2)} the intersection segment contains at least 2 integer grid points.

The following pseudo code provides an example randomized approximation technique:

(1) Input precision ε, angle θ (2) let completion ← null (3)  let Sw ← set of all integers in I_(w)(ε, θ) (4)  while completion == null and Sw ≠ 0 do (5)   Randomly, pick an integer a from Sw (6)   Sw ← Sw − {a} (7)   For all integer d such that (d,a) ∈ D(L)[A_(ε)(θ)] do (8)   if exist b,c ∈ 

(9)   such that 5^(L) − a² − d² = b² + c² then (10)   completion ← (b,c) (11)   Break; (12)   end if (13)   end for (14)  end while (15)  if completion == null then (16)  return null; (17) end if (18) b ← first(completion) (19) c ← last(completion) (20) return U = (a I + b i X + c i Y + d i Z)5^(−L/2)

In the worst case the pseudo code terminates by exhausting the Θ(5^(L/4)) candidate points in the D(L)[A_(ε)(θ)] segment. However, it is noted that this segment is that of Conjecture 1 when p=5. Therefore the share of satisfactory candidates among all of the integer grid points D(L)[A_(ε)(θ)] is Ω(1/√{square root over (L)}). Thus the pseudo code will terminate in O(√{square root over (L)}) iterations on average.

Since the average overall number of iterations is moderate, the largest cost in the pseudo code is line 8. It has been shown that the effective test for an integer ν to be a sum of squares of two integers has expected running cost of O(log²(ν)log(log(ν))). In the present example ν≦8*5^(L/2) and it is estimated the expected cost of the step as O(L² log(L)). Therefore the overall expected cost of the algorithm is O(L^(5/2) log(L)) which translates into O(log(1/ε)^(5/2) log(log(1/ε))).

One can say that the above pseudo code is solving a norm equation in line 8, however this is a norm equation over the simple domain of Gaussian integers and happens to nicely coincide with the well-studied classical problem of decomposing an integer into a sum of two squares.

Empirical Tightening of the Randomized Approximation Technique

As will be discussed below, most, although not all, single-qubit target gates allow approximating circuits with V count V_(c)≦3 log₅(1/ε) for small enough target precision ε. Thus the resource count V_(c)=log₅(1/ε) guaranteed by the above pseudo code for the example randomized approximation technique is too loose in most cases, including in the case of most axial rotations. In some embodiments, the above pseudo code may be tightened by setting L=[c log₅(1/ε)], c<4 in an attempt to find a suitable completion candidate following the same randomized search loop as described above.

c may be iterated from c=3 to c=3.9 with a suitable step size δ_(c). Since polynomial-time termination of the randomized search loop is no longer supported by Conjecture 1, an arbitrary time limit may be set on the search loop for each iteration. The results of this technique on a test set of 1000 random rotations at 6 values of ε indicate that the minimal successful coefficient c satisfies 3.5<c<4, with the average successful c estimated at 3.7. The R gate 204 (see FIG. 2) was determined by the above technique, with c=3.7.

Alternative Basis Set

A foundation for efficient circuit synthesis over the V basis is the set of quaternions of norm 5^(L) and a body of number theory facts and conjectures related to that set. Given an integer prime p such that p=1 mod 4, it is apparent that most of these facts and observations generalize to quaternions of norm p^(L), which are generated by the primitive ones of norm p. Modulo Lipschitz units there are p+1 such quaternions in the generator set. These correspond to a basis of p+1 unitary operators that we denote V′(p). Together with the Pauli gates a subset of (p+1)/2 of the V′(p). operators generate the generalization of the W circuits.

However, in the case of p=5, it was sufficient to add only one V operator in order to ensure the asymptotic uniformity of the grid of

+{V}

circuits. For p >5, additional independent V(p) operators are required. V ₁(13)=(2I+3iZ)/√{square root over (13)},V ₁ ^(†)(13)=(2I−3iZ)/√{square root over (13)}, V ₂(13)=(I+2i(X+Y+Z))/√{square root over (13)},V ₂ ^(†)(13)=(I−2i(X+Y+Z))/√{square root over (13)}, V ₃(13)=(2I+iX+2i(Y+Z))/√{square root over (13)},V ₃ ^(†)(13)=(2I−iX−2i(Y+Z))/√{square root over (13)}, V ₄(13)=(2I+iY+2i(X+Z))/√{square root over (13)},V ₄ ^(†)(13)=(2I−iY−2i(X+Z))/√{square root over (13)}, V ₅(13)=(2I+iZ+2i(X+Y))/√{square root over (13)},V ₅ ^(†)(13)=(2I−iZ−2i(X+Y))/√{square root over (13)}.

A generalization of Thm 2 characterizes the gates representable exactly in the

+{V′ (p)}

basis as normalizations of Lipschitz quaternions of norm p^(L), Lε

. The exact synthesis of the corresponding circuit for a unitary of the form U=(aI+biX+ciY+diZ)/p^(L/2) amounts to a generalization of Algorithm 2 and requires at most (p+1)*L quaternion divisions.

Thm 3 also generalizes to

+{V′(p)}

circuits, to the extent that Conjecture 1 holds for the prime parameter p, and the circuit depth estimate from the theorem generalizes to an estimate of the form L≦4 log_(p)(2/ε).

The V(5) basis set was focused on for at least the reason that the basis requires only one non-Clifford gate for which there is a fault-tolerant implementation protocol.

Direct Search Approximation Technique

Discussed below is a direct search technique for decomposing single-qubit unitaries into a circuit in the set

+V

, where

is the set of single-qubit Pauli gates and V is one of the V gates.

Problem 2 Given an arbitrary single-qubit unitary G ε PSU(2) and a small enough target precision target precision ε, synthesize a W circuit c(G, ε) such that dist(c(G,ε),G)<ε  (7) and the V count of the resulting circuit is V _(c)≦3 log₅(1/ε)  (8) for the majority of target unitaries and V _(c)≦4 log₅(2/ε)  (9) in edge cases.

Let L be the intended V count of the desired approximation circuit. Given a target single-qubit unitary gate represented as G=αI+βiX+γiY+δiZ, in order to find integers (a, b, c, d) such that a²+b²+c²+d²=5^(L) and dist(G,(aI+biX+ciY+diZ)5^(−L/2))<ε,  (10) the α,β,γ,δ coordinates are split into two-variable blocks. Assume that the split is given by (α,δ),(β,γ). For the approximation inequality in equation 10 to hold it is sufficient that (b5^(−L/2)−β)²+(c5^(−L/2)−γ)²<ε²  (11) and (a5^(−L/2)−α)²+(d5^(−L/2)−δ)²<ε².  (12)

In some instances, a precision of ε=5^(−L/3) may be achieved. It can be shown that there are approximately π5^(L/3) integer pairs satisfying each of the conditions in equation 11 and equation 12 for that ε. All of the (b,c) integer pairs may be swept over and a hash table of all of the 5^(L)−b²−c² differences occurring in the first set may be built. Then, all of the (a,d) integer pairs from the second set may be swept over, in search of one for which a²+d² occurs in the hash table.

Using number-theoretical considerations, the number of candidates considered in this direct search can be reduced by a factor of approximately

$\frac{L\; R}{2\sqrt{L\;{\ln(5)}}}$ (where LR is the Landau-Ramanujan constant). Thus, for L=34 the reduction factor is approximately 0.05.

For target unitaries that cannot be approximated to precision 5^(−L/3), the technique may iteratively triple the precision goal (which has an effect of expanding the search space at each iteration) until a satisfactory candidate is found.

Pseudo code for an example direct search technique with inputs of precision ε and target gate G=αI+βiX+γiY+δiZ is as follows:

(1) L ← ┌3*log₅(1/ε)┐ (2) hash ← Dictionary 

 Integer,(Integer * Integer) 

(3) bound±← 5^(L) ({square root over (α² + δ²)} ± ε)² (4) for all b,c ∈ 

 satisfying equation (11) do (5)  if bound−≦ 5^(L) − b² − c² ≦bound+ 5^(L) − b² − c² is decomposable  into two squares then (6)    Add (5^(L) − b² − c²,(b,c)) →hash (7)  end if (8) end for (9) completion ← fail (10) for all integer pairs (a,d) satisfying equation (12) do (11)  if hash contains key equal to a² + d² then (12)   completion ← (a,b,c,d) (13)   Break; (14)  end if (15) end for (16) if completion ≠ fail then (17)  completion ← completion. (I,i X,i Y,i Z)5^(−L/2) (18) end if (19) return completion Conclusion

The above-described techniques generally pertain to quantum devices, quantum algorithms, and simulations of quantum systems on non-quantum devices such as digital computers. Although the techniques have been described in language specific to structural features and/or methodological acts, it is to be understood that the appended claims are not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing such techniques. 

The invention claimed is:
 1. A method for performing quantum calculations, the method comprising: mapping a unitary corresponding to a target quantum gate to a quaternion; factoring the quaternion into a sequence of irreducible quaternion factors; mapping the sequence of irreducible quaternion factors into a sequence of quantum gates of a universal basis set; and applying the sequence of quantum gates to a target qubit.
 2. The method of claim 1, further comprising: determining an amount of precision between the sequence of quantum gates and the target quantum gate; and expressing the unitary as a linear combination of elemental gates of the set of universal basis gates, wherein coefficients of the linear combination of elemental gates are a function of the amount of precision.
 3. The method of claim 2, wherein the coefficients of the linear combination of elemental gates includes a first coefficient and other coefficients, the method further comprising: randomly picking a value of the first coefficient; and determining whether values of the other coefficients exist subject to a constraint imposed by a unitarity condition for the coefficients of the linear combination of elemental gates.
 4. The method of claim 2, further comprising: directly searching for values of the coefficients of the linear combination of elemental gates that exist subject to a constraint imposed by the amount of precision.
 5. The method of claim 4, wherein the coefficients of the linear combination of elemental gates includes a first pair of coefficients and a second pair of coefficients, and wherein directly searching for values of the coefficients of the linear combination of elemental gates further comprises: sweeping over pairs of integer values for the first pair of coefficients; building a hash table based at least in part on a constraint imposed by the amount of precision and the swept over pairs of integer values; and for multiple candidate pairs of integer values, sweeping over the hash table for a specific value corresponding to a respective candidate pair of integer values, wherein the respective candidate pair of integer values are the second pair of coefficients subject to the specific value being in the hash table.
 6. The method of claim 5, wherein the respective candidate pair of integer values is comprised of a first integer and a second integer, and wherein the specific value corresponding to the respective candidate pair of integer values is equal to a sum of the first integer squared and the second integer squared.
 7. The method of claim 5, wherein building the hash table based at least in part on the constraint imposed by the amount of precision and the swept over pairs of integer values comprises, for each swept over pair of integers, determining a sum of squares of integers in the pair of integers; determining a difference between the sum of squares and parameter that is a function of the amount of precision; and including the difference in the hash table.
 8. The method of claim 1, further comprising: storing the sequence of quantum gates of the universal basis set in a storage device.
 9. A quantum circuit comprising: a sequence of quantum gates of a universal basis set that correspond to a target quantum gate, wherein the sequence of quantum gates is made by a process comprising: mapping a unitary corresponding to the target quantum gate to a quaternion; factoring the quaternion into a sequence of irreducible quaternion factors; and mapping the sequence of irreducible quaternion factors into the sequence of quantum gates of the universal basis set.
 10. The quantum circuit of claim 9, wherein the process further comprises: determining an amount of precision between the sequence of quantum gates and the target quantum gate; and expressing the unitary as a linear combination of elemental gates of the set of universal basis gates, wherein coefficients of the linear combination of elemental gates are a function of the amount of precision.
 11. The quantum circuit of claim 10, wherein the coefficients of the linear combination of elemental gates include a first coefficient and other coefficients, and wherein the process further comprises: randomly picking a value of the first coefficient; and determining whether values of the other coefficients exist subject to a constraint imposed by a unitarity condition for the coefficients of the linear combination of elemental gates.
 12. The quantum circuit of claim 10, wherein the process further comprises: directly searching for values of the coefficients of the linear combination of elemental gates that exist subject to a constraint imposed by the amount of precision.
 13. The quantum circuit of claim 12, wherein the coefficients of the linear combination of elemental gates includes a first pair of coefficients and a second pair of coefficients, and wherein directly searching for values of the coefficients of the linear combination of elemental gates further comprises: sweeping over pairs of integer values for the first pair of coefficients; building a hash table based at least in part on a constraint imposed by the amount of precision and the swept over pairs of integer values; and for multiple candidate pairs of integer values, sweeping over the hash table for a specific value corresponding to a respective candidate pair of integer values, wherein the respective candidate pair of integer values are the second pair of coefficients subject to subject to the specific value being in the hash table.
 14. The quantum circuit of claim 13, wherein the respective candidate pair of integer values is comprised of a first integer and a second integer, and wherein the specific value corresponding to the respective candidate pair of integer values is equal to a sum of the first integer squared and the second integer squared.
 15. The quantum circuit of claim 13, wherein building the hash table based at least in part on the constraint imposed by the amount of precision and the swept over pairs of integer values comprises, for each swept over pair of integers, determining a sum of squares of integers in the pair of integers; determining a difference between the sum of squares and parameter that is a function of the amount of precision; and including the difference in the hash table.
 16. A system for quantum-circuit design comprising: a processor; a computer readable storage device storing instructions, wherein the instructions, when executed by the processor, cause the processor to perform acts comprising, mapping a unitary corresponding to a target quantum gate to a quaternion; factoring the quaternion into a sequence of irreducible quaternion factors; mapping the sequence of quaternion factors into a sequence of quantum gates of a universal basis set; and storing the sequence of quantum gates into the computer-readable storage device.
 17. The system of claim 16, wherein acts performed by the processor further include: determining an amount of precision between the sequence of quantum gates and the target quantum circuit; and expressing the unitary as a linear combination of elemental gates of the set of universal basis gates, wherein coefficients of the linear combination of elemental gates are a function of the amount of precision.
 18. The system of claim 17, wherein the coefficients of the linear combination of elemental gates includes a first coefficient and other coefficients, the method further comprising: randomly picking a value of the first coefficient; and determining whether values of the other coefficients exist subject to a constraint imposed by a unitarity condition for the coefficients of the linear combination of elemental gates.
 19. The system of claim 17, further comprising: directly searching for values of the coefficients of the linear combination of elemental gates that exist subject to a constraint imposed by the amount of precision.
 20. The system of claim 19, wherein the coefficients of the linear combination of elemental gates includes a first pair of coefficients and a second pair of coefficients, and wherein directly searching for values of the coefficients of the linear combination of elemental gates further comprises: sweeping over pairs of integer values for the first pair of coefficients; building a hash table based at least in part on a constraint imposed by the amount of precision and the swept over pairs of integer values; and for multiple candidate pairs of integer values, sweeping over the hash table for a specific value corresponding to a respective candidate pair of integer values, wherein the respective candidate pair of integer values are the second pair of coefficients subject to subject to the specific value being in the hash table. 